package cn.xfdzx.android.apps.shop.model;


import cn.xfdzx.android.apps.shop.bean.CategoryAllBeen;
import cn.xfdzx.android.apps.shop.bean.ShopGoodsInfoBeen;
import cn.xfdzx.android.apps.shop.bean.ShopAddGoodBeen;
import cn.xfdzx.android.apps.shop.bean.ShopAddGoodTypeBeen;
import cn.xfdzx.android.apps.shop.bean.UpdateNumPriceBeen;
import cn.xfdzx.android.apps.shop.contract.ShopAddGoodContract;
import cn.xfdzx.android.apps.shop.net.RetrofitClient;
import io.reactivex.Flowable;

/**
 * @author azheng
 * @date 2018/6/4.
 * Description：
 */
public class ShopAddGoodModel implements ShopAddGoodContract.Model {


    @Override
    public Flowable<ShopAddGoodBeen> addGood(String state,String title, String thumbs, String marketprice, String discountprice, String stock, String category_id, String store_category_id, String goods_weight, String unit) {
        return RetrofitClient.getInstance().getApi().store_add_good(state, title,  thumbs,  marketprice,  discountprice,  stock,  category_id,  store_category_id,  goods_weight,  unit);
    }

    @Override
    public Flowable<ShopAddGoodBeen> updataGood(String id,String state,String title, String thumbs, String marketprice, String discountprice, String stock, String category_id, String store_category_id, String goods_weight, String unit) {
        return RetrofitClient.getInstance().getApi().shopGoodUpdate(id,state, title,  thumbs,  marketprice,  discountprice,  stock,  category_id,  store_category_id,  goods_weight,  unit);
    }

    @Override
    public Flowable<CategoryAllBeen> initTypeData(String index_status) {
        return RetrofitClient.getInstance().getApi().oneCategoryAll(index_status );
    }

    @Override
    public Flowable<ShopAddGoodTypeBeen> shopAddGoodType() {
        return  RetrofitClient.getInstance().getApi().category_list();
    }

    @Override
    public Flowable<ShopGoodsInfoBeen> goodsInfo(String id) {
        return  RetrofitClient.getInstance().getApi().goods_info(id);
    }



}
